home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5915 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 67 61 | 6c 69 6c 65 6f 2e 70 6f |Path: ga|lileo.po|
|00000010| 6c 69 74 6f 2e 69 74 21 | 75 73 65 6e 65 74 0a 46 |lito.it!|usenet.F|
|00000020| 72 6f 6d 3a 20 4c 6f 20 | 52 75 73 73 6f 20 47 72 |rom: Lo |Russo Gr|
|00000030| 61 7a 69 61 6e 6f 20 3c | 6c 6f 72 75 73 73 6f 40 |aziano <|lorusso@|
|00000040| 63 73 65 6c 74 2e 73 74 | 65 74 2e 69 74 3e 0a 4e |cselt.st|et.it>.N|
|00000050| 65 77 73 67 72 6f 75 70 | 73 3a 20 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000060| 6c 61 6e 67 2e 63 2b 2b | 0a 53 75 62 6a 65 63 74 |lang.c++|.Subject|
|00000070| 3a 20 52 65 3a 20 53 54 | 4c 20 63 6f 6e 74 61 69 |: Re: ST|L contai|
|00000080| 6e 65 72 20 63 6c 61 73 | 73 65 73 20 61 6e 64 20 |ner clas|ses and |
|00000090| 64 65 73 74 72 6f 79 28 | 29 0a 44 61 74 65 3a 20 |destroy(|).Date: |
|000000a0| 37 20 46 65 62 20 31 39 | 39 36 20 31 33 3a 32 36 |7 Feb 19|96 13:26|
|000000b0| 3a 32 33 20 47 4d 54 0a | 4f 72 67 61 6e 69 7a 61 |:23 GMT.|Organiza|
|000000c0| 74 69 6f 6e 3a 20 63 73 | 65 6c 74 0a 4d 65 73 73 |tion: cs|elt.Mess|
|000000d0| 61 67 65 2d 49 44 3a 20 | 3c 34 66 61 39 39 76 24 |age-ID: |<4fa99v$|
|000000e0| 38 69 39 40 67 61 6c 69 | 6c 65 6f 2e 70 6f 6c 69 |8i9@gali|leo.poli|
|000000f0| 74 6f 2e 69 74 3e 0a 52 | 65 66 65 72 65 6e 63 65 |to.it>.R|eference|
|00000100| 73 3a 20 3c 50 69 6e 65 | 2e 42 53 46 2e 33 2e 39 |s: <Pine|.BSF.3.9|
|00000110| 31 2e 39 36 30 32 30 34 | 32 30 32 30 33 36 2e 37 |1.960204|202036.7|
|00000120| 38 30 36 41 2d 31 30 30 | 30 30 30 40 63 79 62 2e |806A-100|000@cyb.|
|00000130| 67 72 69 64 70 6f 69 6e | 74 2e 63 6f 6d 3e 0a 4e |gridpoin|t.com>.N|
|00000140| 4e 54 50 2d 50 6f 73 74 | 69 6e 67 2d 48 6f 73 74 |NTP-Post|ing-Host|
|00000150| 3a 20 64 72 6f 67 6f 2e | 63 73 65 6c 74 2e 73 74 |: drogo.|cselt.st|
|00000160| 65 74 2e 69 74 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |et.it.Mi|me-Versi|
|00000170| 6f 6e 3a 20 31 2e 30 0a | 43 6f 6e 74 65 6e 74 2d |on: 1.0.|Content-|
|00000180| 54 79 70 65 3a 20 74 65 | 78 74 2f 70 6c 61 69 6e |Type: te|xt/plain|
|00000190| 3b 20 63 68 61 72 73 65 | 74 3d 75 73 2d 61 73 63 |; charse|t=us-asc|
|000001a0| 69 69 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |ii.Conte|nt-Trans|
|000001b0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 37 62 |fer-Enco|ding: 7b|
|000001c0| 69 74 0a 58 2d 4d 61 69 | 6c 65 72 3a 20 4d 6f 7a |it.X-Mai|ler: Moz|
|000001d0| 69 6c 6c 61 20 31 2e 31 | 4e 20 28 57 69 6e 64 6f |illa 1.1|N (Windo|
|000001e0| 77 73 3b 20 49 3b 20 31 | 36 62 69 74 29 0a 54 6f |ws; I; 1|6bit).To|
|000001f0| 3a 20 6c 6f 6f 64 76 72 | 69 6a 40 63 79 62 2e 67 |: loodvr|ij@cyb.g|
|00000200| 72 69 64 70 6f 69 6e 74 | 2e 63 6f 6d 0a 0a 3e 2d |ridpoint|.com..>-|
|00000210| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000230| 2d 2d 2d 2d 2d 2d 38 3c | 2d 2d 2d 2d 2d 2d 2d 2d |------8<|--------|
|00000240| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000250| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0a 3e 23 69 6e 63 6c |--------|-.>#incl|
|00000260| 75 64 65 20 3c 76 65 63 | 74 6f 72 2e 68 3e 0a 3e |ude <vec|tor.h>.>|
|00000270| 0a 3e 63 6c 61 73 73 20 | 61 73 64 66 0a 3e 7b 0a |.>class |asdf.>{.|
|00000280| 3e 20 20 20 20 61 73 64 | 66 28 29 20 7b 7d 0a 3e |> asd|f() {}.>|
|00000290| 20 20 20 20 7e 61 73 64 | 66 28 29 20 7b 7d 0a 3e | ~asd|f() {}.>|
|000002a0| 20 20 20 20 69 6e 74 20 | 73 70 61 6d 3b 0a 3e 7d | int |spam;.>}|
|000002b0| 3b 0a 3e 0a 3e 63 6c 61 | 73 73 20 42 6c 61 68 0a |;.>.>cla|ss Blah.|
|000002c0| 3e 7b 0a 3e 20 20 20 20 | 76 65 63 74 6f 72 3c 61 |>{.> |vector<a|
|000002d0| 73 64 66 3e 20 61 73 64 | 66 4c 69 73 74 3b 0a 3e |sdf> asd|fList;.>|
|000002e0| 7d 3b 0a 3e 0a 3e 69 6e | 74 20 6d 61 69 6e 20 28 |};.>.>in|t main (|
|000002f0| 69 6e 74 2c 20 63 68 61 | 72 20 2a 2a 29 0a 3e 7b |int, cha|r **).>{|
|00000300| 0a 3e 20 20 20 20 42 6c | 61 68 20 62 6c 61 68 3b |.> Bl|ah blah;|
|00000310| 20 0a 3e 7d 0a 3e 0a 3e | 78 6c 43 20 2d 2b 20 2d | .>}.>.>|xlC -+ -|
|00000320| 55 5f 5f 53 54 52 5f 5f | 20 2d 49 73 74 6c 20 2d |U__STR__| -Istl -|
|00000330| 67 0a 3e 2d 44 4d 4f 44 | 5f 53 59 4d 3d 33 44 63 |g.>-DMOD|_SYM=3Dc|
|00000340| 74 67 6e 64 20 2d 44 4d | 4f 44 55 4c 45 5f 4e 41 |tgnd -DM|ODULE_NA|
|00000350| 4d 45 3d 33 44 22 63 74 | 67 6e 64 22 20 2d 63 20 |ME=3D"ct|gnd" -c |
|00000360| 76 65 63 74 6f 72 2d 74 | 65 73 74 2e 63 63 0a 3e |vector-t|est.cc.>|
|00000370| 22 73 74 6c 2f 64 65 66 | 61 6c 6c 6f 63 2e 68 22 |"stl/def|alloc.h"|
|00000380| 2c 20 6c 69 6e 65 20 37 | 34 2e 31 3a 20 31 35 34 |, line 7|4.1: 154|
|00000390| 30 2d 30 31 33 3a 20 28 | 53 29 20 22 7e 54 22 20 |0-013: (|S) "~T" |
|000003a0| 69 73 20 75 6e 64 65 66 | 69 6e 65 64 2e 0a 3e 22 |is undef|ined..>"|
|000003b0| 73 74 6c 2f 64 65 66 61 | 6c 6c 6f 63 2e 68 22 2c |stl/defa|lloc.h",|
|000003c0| 20 6c 69 6e 65 20 37 33 | 2e 31 3a 20 31 35 34 30 | line 73|.1: 1540|
|000003d0| 2d 32 30 37 3a 20 28 49 | 29 20 54 68 65 20 70 72 |-207: (I|) The pr|
|000003e0| 65 76 69 6f 75 73 20 6d | 65 73 73 61 67 65 20 61 |evious m|essage a|
|000003f0| 70 70 6c 69 65 73 20 0a | 3e 74 6f 20 74 68 65 20 |pplies .|>to the |
|00000400| 64 65 66 69 6e 69 74 69 | 6f 6e 20 6f 66 20 74 65 |definiti|on of te|
|00000410| 6d 70 6c 61 74 65 20 22 | 64 65 73 74 72 6f 79 28 |mplate "|destroy(|
|00000420| 61 73 64 66 2a 29 22 2e | 0a 3e 0a 3e 0a 0a 48 69 |asdf*)".|.>.>..Hi|
|00000430| 2e 0a 49 20 64 6f 6e 27 | 74 20 75 73 65 20 49 42 |..I don'|t use IB|
|00000440| 4d 43 20 43 2b 2b 2c 20 | 62 75 74 20 74 68 65 20 |MC C++, |but the |
|00000450| 70 72 6f 62 6c 65 6d 20 | 69 73 20 69 6e 74 72 69 |problem |is intri|
|00000460| 67 75 69 6e 67 2e 0a 53 | 54 4c 20 75 73 65 73 20 |guing..S|TL uses |
|00000470| 61 20 66 65 61 74 75 72 | 65 73 20 74 68 61 74 20 |a featur|es that |
|00000480| 68 61 73 20 62 65 65 6e | 20 70 72 65 73 65 6e 74 |has been| present|
|00000490| 20 73 69 6e 63 65 20 74 | 68 65 20 41 52 4d 20 64 | since t|he ARM d|
|000004a0| 61 79 73 20 62 75 74 20 | 49 20 74 68 69 6e 6b 20 |ays but |I think |
|000004b0| 68 61 73 20 6e 6f 74 20 | 65 76 65 72 20 62 65 65 |has not |ever bee|
|000004c0| 6e 20 75 73 65 64 20 0a | 28 61 6e 64 20 69 6d 70 |n used .|(and imp|
|000004d0| 6c 65 6d 65 6e 74 65 64 | 29 20 62 65 66 6f 72 65 |lemented|) before|
|000004e0| 3a 20 74 68 65 20 61 62 | 69 6c 69 74 79 20 74 6f |: the ab|ility to|
|000004f0| 20 63 61 6c 6c 20 61 6e | 20 6f 62 6a 65 63 74 27 | call an| object'|
|00000500| 73 20 64 65 73 74 72 75 | 63 74 6f 72 20 54 3a 3a |s destru|ctor T::|
|00000510| 7e 54 20 2a 77 69 74 68 | 6f 75 74 2a 20 70 61 73 |~T *with|out* pas|
|00000520| 73 69 6e 67 20 0a 74 68 | 72 6f 75 67 68 20 22 64 |sing .th|rough "d|
|00000530| 65 6c 65 74 65 20 54 22 | 2e 20 53 54 4c 20 64 6f |elete T"|. STL do|
|00000540| 65 73 20 74 68 69 73 20 | 62 65 63 61 75 73 65 20 |es this |because |
|00000550| 73 6f 6d 65 74 69 6d 65 | 73 20 69 74 20 75 73 65 |sometime|s it use|
|00000560| 73 20 72 61 77 20 64 61 | 74 61 20 73 74 72 75 63 |s raw da|ta struc|
|00000570| 74 75 72 65 73 20 28 69 | 2e 65 2e 20 62 79 74 65 |tures (i|.e. byte|
|00000580| 20 0a 62 75 66 66 65 72 | 73 29 20 74 6f 20 68 6f | .buffer|s) to ho|
|00000590| 6c 64 20 6f 62 6a 65 63 | 74 73 2c 20 73 6f 20 69 |ld objec|ts, so i|
|000005a0| 74 20 6e 65 65 64 73 20 | 74 6f 20 63 61 6c 6c 20 |t needs |to call |
|000005b0| 74 68 65 20 63 6f 6e 73 | 74 72 75 63 74 6f 72 20 |the cons|tructor |
|000005c0| 61 6e 64 20 64 65 73 74 | 72 75 63 74 6f 72 73 20 |and dest|ructors |
|000005d0| 66 6f 72 20 74 68 65 73 | 65 20 6f 62 6a 65 63 74 |for thes|e object|
|000005e0| 73 20 0a 77 69 74 68 6f | 75 74 20 61 6c 6c 6f 63 |s .witho|ut alloc|
|000005f0| 61 74 69 6e 67 2f 64 65 | 61 6c 6c 6f 63 61 74 69 |ating/de|allocati|
|00000600| 6e 67 20 6d 65 6d 65 6f | 72 79 20 74 6f 6f 2e 20 |ng memeo|ry too. |
|00000610| 55 73 69 6e 67 20 22 6e | 65 77 20 28 70 29 20 54 |Using "n|ew (p) T|
|00000620| 22 20 73 6f 6c 76 65 73 | 20 74 68 65 20 70 72 6f |" solves| the pro|
|00000630| 62 6c 65 6d 20 77 68 65 | 6e 20 0a 63 6f 6e 73 74 |blem whe|n .const|
|00000640| 72 75 63 74 69 6e 67 20 | 61 6e 20 6f 62 6a 65 63 |ructing |an objec|
|00000650| 74 20 61 74 20 61 20 66 | 69 78 65 64 20 61 64 64 |t at a f|ixed add|
|00000660| 72 65 73 73 3b 20 62 75 | 74 20 53 54 4c 20 63 61 |ress; bu|t STL ca|
|00000670| 6c 6c 73 20 61 6e 20 6f | 62 6a 65 63 74 20 64 65 |lls an o|bject de|
|00000680| 73 74 72 75 63 74 6f 72 | 20 74 6f 6f 2c 20 49 20 |structor| too, I |
|00000690| 74 68 69 6e 6b 20 77 69 | 74 68 20 0a 61 20 73 79 |think wi|th .a sy|
|000006a0| 6e 74 61 78 20 6c 69 6b | 65 20 6c 69 6b 65 20 54 |ntax lik|e like T|
|000006b0| 3a 3a 7e 54 28 29 28 70 | 6f 69 6e 74 65 72 2d 74 |::~T()(p|ointer-t|
|000006c0| 6f 2d 6f 62 6a 65 63 74 | 29 2e 20 54 68 69 73 20 |o-object|). This |
|000006d0| 69 73 20 61 20 63 6f 6d | 70 69 6c 65 72 20 74 6f |is a com|piler to|
|000006e0| 72 74 75 72 65 20 62 79 | 20 69 74 73 65 6c 66 2e |rture by| itself.|
|000006f0| 20 57 68 61 74 27 73 20 | 0a 77 6f 72 73 65 2c 20 | What's |.worse, |
|00000700| 54 20 63 61 6e 20 62 65 | 20 61 20 43 20 62 75 69 |T can be| a C bui|
|00000710| 6c 74 2d 69 6e 20 74 79 | 70 65 2e 20 52 65 71 75 |lt-in ty|pe. Requ|
|00000720| 69 72 69 6e 67 20 61 20 | 63 6f 6d 6d 6f 6e 20 43 |iring a |common C|
|00000730| 2b 2b 20 63 6f 6d 70 69 | 6c 65 72 20 74 6f 20 61 |++ compi|ler to a|
|00000740| 63 63 65 70 74 20 61 6e | 20 65 78 70 6c 69 63 69 |ccept an| explici|
|00000750| 74 20 63 61 6c 6c 20 0a | 74 6f 20 74 68 65 20 64 |t call .|to the d|
|00000760| 65 73 74 72 75 63 74 6f | 72 20 6f 66 20 61 6e 20 |estructo|r of an |
|00000770| 69 6e 74 20 77 6f 75 6c | 64 20 68 61 76 65 20 62 |int woul|d have b|
|00000780| 65 65 6e 20 74 6f 6f 20 | 6d 75 63 68 20 2e 20 53 |een too |much . S|
|00000790| 6f 20 53 54 4c 20 63 61 | 6c 6c 73 20 64 65 73 74 |o STL ca|lls dest|
|000007a0| 72 6f 79 28 29 20 74 6f | 20 63 61 6c 6c 20 74 68 |roy() to| call th|
|000007b0| 65 20 0a 64 65 73 74 72 | 6f 79 65 72 20 6f 66 20 |e .destr|oyer of |
|000007c0| 61 20 76 61 6c 75 65 3b | 20 62 79 20 64 65 66 61 |a value;| by defa|
|000007d0| 75 6c 74 2c 20 64 65 73 | 74 72 6f 79 20 63 61 6c |ult, des|troy cal|
|000007e0| 6c 73 20 74 68 65 20 64 | 65 73 74 72 75 63 74 6f |ls the d|estructo|
|000007f0| 72 20 28 54 3a 3a 7e 54 | 29 2c 20 62 75 74 20 79 |r (T::~T|), but y|
|00000800| 6f 75 20 63 61 6e 20 6f | 76 65 72 6c 6f 61 64 20 |ou can o|verload |
|00000810| 69 74 20 0a 74 6f 20 64 | 6f 20 77 68 61 74 65 76 |it .to d|o whatev|
|00000820| 65 72 20 79 6f 75 20 77 | 61 6e 74 2e 20 46 6f 72 |er you w|ant. For|
|00000830| 20 69 6e 73 74 61 6e 63 | 65 2c 20 53 54 4c 20 64 | instanc|e, STL d|
|00000840| 65 66 69 6e 65 73 20 64 | 65 73 74 72 6f 79 28 29 |efines d|estroy()|
|00000850| 20 66 6f 72 20 74 68 65 | 20 43 20 62 75 69 6c 74 | for the| C built|
|00000860| 2d 69 6e 20 74 79 70 65 | 73 20 74 6f 20 64 6f 20 |-in type|s to do |
|00000870| 0a 6e 6f 74 68 69 6e 67 | 2e 0a 4e 6f 77 20 74 6f |.nothing|..Now to|
|00000880| 20 79 6f 75 72 20 70 72 | 6f 62 6c 65 6d 2e 20 57 | your pr|oblem. W|
|00000890| 6f 75 6c 64 20 79 6f 75 | 20 6c 69 6b 65 20 74 6f |ould you| like to|
|000008a0| 20 74 72 79 20 6d 61 6b | 69 6e 67 20 61 73 64 66 | try mak|ing asdf|
|000008b0| 3a 3a 7e 61 73 64 66 28 | 29 20 6e 6f 74 20 69 6e |::~asdf(|) not in|
|000008c0| 6c 69 6e 65 3f 20 4d 61 | 79 62 65 20 79 6f 75 72 |line? Ma|ybe your|
|000008d0| 20 63 6f 6d 70 69 6c 65 | 72 20 0a 6f 70 74 69 6d | compile|r .optim|
|000008e0| 69 7a 65 20 61 77 61 79 | 20 74 68 65 20 64 65 66 |ize away| the def|
|000008f0| 69 6e 69 74 69 6f 6e 20 | 6f 66 20 69 6e 6c 69 6e |inition |of inlin|
|00000900| 65 2c 20 6e 6f 74 20 76 | 69 72 74 75 61 6c 20 66 |e, not v|irtual f|
|00000910| 75 6e 63 74 69 6f 6e 73 | 3a 20 69 66 20 69 74 20 |unctions|: if it |
|00000920| 63 61 6e 20 65 78 70 61 | 6e 64 20 74 68 65 6d 20 |can expa|nd them |
|00000930| 69 6e 6c 69 6e 65 2c 20 | 0a 77 68 79 20 73 68 6f |inline, |.why sho|
|00000940| 75 6c 64 20 69 74 20 62 | 6f 74 68 65 72 20 64 65 |uld it b|other de|
|00000950| 66 69 6e 69 6e 67 20 61 | 20 74 72 75 65 20 66 75 |fining a| true fu|
|00000960| 6e 63 74 69 6f 6e 3f 20 | 4f 66 20 63 6f 75 72 73 |nction? |Of cours|
|00000970| 65 2c 20 69 6e 20 74 68 | 69 73 20 63 61 73 65 20 |e, in th|is case |
|00000980| 74 68 69 73 20 61 20 63 | 6f 6d 70 69 6c 65 72 20 |this a c|ompiler |
|00000990| 62 75 67 2c 20 62 75 74 | 20 0a 49 20 6b 6e 6f 77 |bug, but| .I know|
|000009a0| 20 6f 66 20 77 6f 72 73 | 65 20 43 2b 2b 20 63 6f | of wors|e C++ co|
|000009b0| 6d 70 69 6c 65 72 20 62 | 75 67 73 20 2e 2e 2e 20 |mpiler b|ugs ... |
|000009c0| 28 42 54 57 2c 20 74 68 | 65 20 48 50 20 69 6d 70 |(BTW, th|e HP imp|
|000009d0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 53 |lementat|ion of S|
|000009e0| 54 4c 20 64 6f 65 73 20 | 6e 6f 74 20 63 6f 6d 70 |TL does |not comp|
|000009f0| 69 6c 65 20 77 69 74 68 | 20 0a 74 68 65 20 48 50 |ile with| .the HP|
|00000a00| 20 63 6f 6d 70 69 6c 65 | 72 2c 20 6e 6f 72 20 77 | compile|r, nor w|
|00000a10| 69 74 68 20 74 68 65 20 | 53 75 6e 2c 20 47 4e 55 |ith the |Sun, GNU|
|00000a20| 2c 20 4d 69 63 72 6f 73 | 6f 66 74 20 65 74 63 2e |, Micros|oft etc.|
|00000a30| 20 6f 6e 65 73 29 0a 0a | 50 6c 65 61 73 65 20 74 | ones)..|Please t|
|00000a40| 65 6c 6c 20 6d 65 20 69 | 66 20 61 6e 64 20 68 6f |ell me i|f and ho|
|00000a50| 77 20 79 6f 75 20 63 6f | 75 6c 64 20 73 6f 6c 76 |w you co|uld solv|
|00000a60| 65 20 74 68 65 20 70 72 | 6f 62 6c 65 6d 2e 0a 0a |e the pr|oblem...|
|00000a70| 28 53 6f 72 72 79 20 66 | 6f 72 20 6d 79 20 70 6f |(Sorry f|or my po|
|00000a80| 6f 72 20 45 6e 67 6c 69 | 73 68 20 2e 2e 2e 29 0a |or Engli|sh ...).|
|00000a90| 0a 42 79 65 2e 0a 0a 47 | 72 61 7a 69 61 6e 6f 20 |.Bye...G|raziano |
|00000aa0| 4c 6f 20 52 75 73 73 6f | 0a 0a |Lo Russo|.. |
+--------+-------------------------+-------------------------+--------+--------+